package com.umeox.watch.moto.dataservice.db.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.DeviceCode;

/**
 * Created by Rambo 2021/9/16
 * Describe:
 */
@Dao
public interface DeviceCodeDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(DeviceCode deviceCode);

    @Query("SELECT * FROM device_code WHERE deviceId=:deviceId")
    DeviceCode queryByDeviceId(String deviceId);

    @Delete
    int delete(DeviceCode deviceCode);

    @Query("DELETE FROM device_code")
    int deleteAll();


}
